import { get } from "https";

const Router = require("koa-router")
const router = new Router()

@controller('/api/v0/movie')
export class movieController {
    @get('/')
    @login
    async getMovies (ctx,next) {
        const Movie = mogoose.model('Movie')
        const movies = await Movie.find({}).sort({
            'meta.createdAt' : -1
        })
        ctx.body = {
            movies
        }
    }

    @get('/:id')
    async getMovieDetail (ctx,next) {
        const details = [];
        ctx.body = {
            details
        }
    }
}